home *** CD-ROM | disk | FTP | other *** search
/ Trading on the Edge / Trading On The Edge - CD-ROM Toolkit (Wayzata Technology)(2031)(1994).bin / pc / mac_file / vendor_d / neuralwa / nw2v50 / hopfield.inh < prev    next >
Text File  |  1993-08-23  |  3KB  |  108 lines

  1. inst4.1        !01-Jun-88  (hopfield.ins)  Hopfield Network Builder
  2. !****************************************************************
  3. !*                                *
  4. !*    Hopfield Network Generator                *
  5. !*                                *
  6. !****************************************************************
  7.  
  8. !    *** check that input PE count is non-zero
  9.  
  10. ?&In    1
  11. >bge    CheckOut
  12. @Err    "Hopfield MUST have at least one input PE"
  13. :CheckOut
  14.  
  15. !    *** Load the Control Strategy and LRS if needed
  16.  
  17. @LdCS    "hopfield"        !control strategy
  18. @LdLR    "hopfield"        !L/R schedule
  19.  
  20. =netn    "InstaNet (tm) Hopfield Network version 2.00 01-Jun-89"
  21. =DLnF    0            !learn  re-display off
  22. =DRcF    0            !recall re-display off
  23.  
  24. !    *** Build the Input Layer ***
  25.  
  26. @LLdf                !load default layer to mi_layer structure
  27. =LDln    "In"            !layer name
  28. =Lpes    &In            !copy # of input PEs from menu
  29. =Ltrn    "StepFunction"        !transfer function
  30. =x    100            !place to put layer on screen
  31. =y     50
  32. #Incl    "stdnwgtf.iif"        !standard # weight fields
  33. @LAdd                !add the input layer
  34. =n0    LayN            !track previous layer
  35.  
  36. !    *** Build the Hopfield Layer ***
  37.  
  38. @LLdf                !start with default layer again
  39. =LDln    "Hopfield"        !layer name
  40. =Lpes    &In            !desired number of PEs
  41. =Ltrn    "StepFunction"        !transfer function
  42. =Llrn    "Hopfield"        !learning rule
  43. =LInL    0.0            !low initialization limit
  44. =LInH    0.0            !high initialization limit
  45. +y    170            !up higher on display
  46. #Incl    "stdnwgtf.iif"        !standard # weight fields
  47. @LAdd
  48.  
  49. !    *** Connect it to the input layer ***
  50.  
  51. =SPEl    LayN            !current layer
  52. @SlPE
  53. =NPEl    n0            !input layer
  54. @NrPE
  55. =cnwt    1.0            !unit weight
  56. =cnsc    WRel
  57. =cnty    WSet
  58. @LCCr                !connect corresponding items
  59.  
  60. !    *** Connect it to itself ***
  61.  
  62. =NPEl    LayN
  63. @NrPE
  64. =cnwt    0.0            !zero weights
  65. =cnty    WVar            !trainable
  66. =cnsc    WAbs
  67. @LCFl                !fully connect (except diagonal)
  68. =n0    LayN            !track previous layer
  69.  
  70. !    *** Build the Output Layer ***
  71.  
  72. @LLdf                !start with default layer again
  73. =LDln    "Output"        !layer name
  74. =Lpes    &In            !desired number of PEs
  75. +y    60            !up higher on display
  76. #Incl    "stdnwgtf.iif"        !standard # weight fields
  77. @LAdd
  78.  
  79. !    *** Connect the output layer back to the hopfield layer ***
  80.  
  81. =SPEl    LayN            !select output layer
  82. @SlPE
  83. =cnwt    1.0            !unit weight
  84. =cnty    WFix            !fixed
  85. =cnsc    WRel
  86. @LCCr
  87.  
  88. !    *** Select Control Strategy & L/R Schedule ***
  89.  
  90. @LLsl                !load super layer
  91. =Lctl    "hopfield"        !control strategy
  92. =Llrs    "hopfield"        !L/R Schedule
  93. =Llnn    "hopfield"        !name of learn input
  94. =Lrcn    "hopfield"        !name of recall output
  95. +Lflg    LAAs            !auto-associative
  96. =Lscl     0            !input  low-value
  97. =Loff     1            !input  high-value
  98. =Llow     0            !output low-value
  99. =Lhgh     1            !output high-value
  100. =Lax1    Epch            !epoch size
  101. @SVsl                !save it back
  102. !
  103. !=Grph     1
  104. !=GrLF    "hopfield"        !instrument list file
  105. !
  106. @Nini
  107. @EOF
  108.